package com.gitee.wsl.android.ui

import android.graphics.PathMeasure
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.asComposePath

import androidx.graphics.shapes.CornerRounding
import androidx.graphics.shapes.Morph
import androidx.graphics.shapes.RoundedPolygon
import androidx.graphics.shapes.toPath

class Test {
    val size = Size(18f,18f)
    val triangle = RoundedPolygon(
        numVertices = 3,
        radius = size.minDimension / 2f,
        centerX = size.width / 2f,
        centerY = size.height / 2f,
        rounding = CornerRounding(
            size.minDimension / 10f,
            smoothing = 0.1f
        )
    )
    val square = RoundedPolygon(
        numVertices = 4,
        radius = size.minDimension / 2f,
        centerX = size.width / 2f,
        centerY = size.height / 2f
    )

    val morph = Morph(start = triangle, end = square)
    val morphPath = morph
        .toPath(progress = 0.5f).asComposePath()
}